﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace SurveyGUI
{
    public partial class frmdoimatkhau : Form
    {
        SqlConnection con;
        SqlDataAdapter da;
        string conectionString;

        private string tendangnhap;
        public frmdoimatkhau()
        {
            InitializeComponent();
        }

        public frmdoimatkhau(string ten):this()
        {
            this.tendangnhap = ten;
            txttendangnhap.Text = tendangnhap;
        }


        private void btnhuy_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {

            conectionString = "Data Source=TRANNAMHAI-PC\\SQLEXPRESS;Initial Catalog=DuLieu;Integrated Security=True";
            string query = "UPDATE ThanhVien SET MatKhau='" + txtmatkhaumoi.Text + "' where Ten like haictk33";    //'" + tenDangNhap + "'";
            da = new SqlDataAdapter(query, con);
            MessageBox.Show("OK");

            //string matkhau="123";
            //string matkhau1 = txtmatkhaumoi.Text.ToString();
            //int kq=matkhau.CompareTo(matkhau1);
            //if (kq==0)
            //{
            //    MessageBox.Show("Thanh cong");
            //}


        }

        private void frmdoimatkhau_Load(object sender, EventArgs e)
        {
           
        }
    }
}
